// views/templates.go

package views

import (
	"github.com/gin-gonic/gin"
	"html/template"
)

type Templates struct {
	templates *template.Template
}

func InitTemplates() *Templates {
	tmpl := template.Must(template.ParseGlob("略略略略略略略略略略略略略略略略略略略略"))
	return &Templates{
		templates: tmpl,
	}
}

func (t *Templates) Render(c *gin.Context, code int, name string, data gin.H) {
	c.Status(code)
	err := t.templates.ExecuteTemplate(c.Writer, name, data)
	if err != nil {
		c.Error(err)
	}
}
